<?php
namespace Database;

class SystemTask extends Base
{

    public function __construct()
    {
        $this->setModel(MODEL_SYSTEMTASK);
    }

    public function getTaskList($pageSize = 1000)
    {
        $dateTime = getDateTime();
        $sql = $this->getSql();
        $sql->field('*');
        $sql->table($this->getTable());
        $sql->where('dry_status', '=', 1);
        $sql->andWhere('dry_finish', '=', 0);
        $sql->andWhere('dry_start_time', '<=', $dateTime['date_time']);
        $sql->andWhere('dry_end_time', '>=', $dateTime['date_time']);
        $sql->andWhere('dry_next_time', '<=', $dateTime['date_time']);
        $sql->whereRaw(' and dry_try < dry_total');
        $sql->setPage(1);
        $sql->setPageSize($pageSize);
        $sql->setLimit();
        return $this->fetchAll($sql->get());
    }

}